$def with (record, filename, begin, length, books)
$# Template entry point for MARC record's that are not amazon or IA.
$# e.g. /show-records/marc_upei/marc-for-openlibrary-bigset.mrc:4980114:1308
$ format = query_param('format')
$if format == 'raw':
    $var content_type: application/marc
    $var rawtext = record.data

$ get_source_record = render_template("history/sources").get_source_record
$ source_record = get_source_record("%s:%s:%s" % (filename, begin, length))
$ title = "MARC Record from " + source_record.source_name
$ next_url = "../%s:%s:5" % (filename, begin + length)

$var title: $title

<div id="contentHead">
    $if len(books):
        $ e = get_document(books[0])
        <div class="breadcrumbs"><a href="$e.key">$e.title</a> /</div>
    <h1>$title</h1>
</div>

<div id="contentBody">
    <div class="section">
        <table class="meta">
            <tbody>
                <tr>
                    <td class="title"><span class="title">Record ID</span></td>
                    <td><span class="object">$source_record.id</span></td>
                </tr>
                <tr>
                    <td class="title"><span class="title">Source</span></td>
                    <td><span class="object"><a href="$source_record.source_url">$source_record.source_name</a></span></td>
                </tr>
                <tr>
                    <td class="title"><span class="title">Download Link</span></td>
                    <td><span class="object"><a href="$source_record.url?format=raw">$source_record.url?format=raw</a></span></td>
                </tr>
            </tbody>
        </table>
    </div>

    $if not record:
        <p>$_("Invalid MARC record.")</p>
    $else:
        <p><b>LEADER:</b> <code>$record.leader</code><br/>
        $:record.html()</p>
   $if ctx.user and (ctx.user.is_admin() or ctx.user.is_librarian()):
       <div>
          <a href="$next_url" class="slick-next adminOnly right">$_("Next")</a>
       </div>
</div>
